<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>mongodb系列十一之性能优化 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="capped collection　　capped Collections 比普通 Collections 的读写效率高。 Capped Collections 是高效率的 Collection类型，它有如下特点：

固定大小；Capped Collections 必须事先创建，并设置大小：db.createCollection(“mycoll”, {capped:true, size:10000">
<meta property="og:type" content="article">
<meta property="og:title" content="mongodb系列十一之性能优化">
<meta property="og:url" content="http://yoursite.com/2015/12/18/mongodb/11.mongodb系列之优化/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="capped collection　　capped Collections 比普通 Collections 的读写效率高。 Capped Collections 是高效率的 Collection类型，它有如下特点：

固定大小；Capped Collections 必须事先创建，并设置大小：db.createCollection(“mycoll”, {capped:true, size:10000">
<meta property="og:updated_time" content="2016-01-29T17:47:36.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="mongodb系列十一之性能优化">
<meta name="twitter:description" content="capped collection　　capped Collections 比普通 Collections 的读写效率高。 Capped Collections 是高效率的 Collection类型，它有如下特点：

固定大小；Capped Collections 必须事先创建，并设置大小：db.createCollection(“mycoll”, {capped:true, size:10000">
  
    <link rel="alternative" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="/css/style.css" type="text/css">
  

</head>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-mongodb/11.mongodb系列之优化" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2015/12/18/mongodb/11.mongodb系列之优化/" class="article-date">
  <time datetime="2015-12-18T03:00:00.000Z" itemprop="datePublished">2015-12-18</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/mongodb/">mongodb</a>
  </div>

  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      mongodb系列十一之性能优化
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="capped_collection"><a href="#capped_collection" class="headerlink" title="capped collection"></a>capped collection</h2><p>　　capped Collections 比普通 Collections 的读写效率高。 Capped Collections 是高效率的 Collection类型，它有如下特点：</p>
<ol>
<li>固定大小；Capped Collections 必须事先创建，并设置大小：db.createCollection(“mycoll”, {capped:true, size:100000})</li>
<li>Capped Collections 可以 insert 和 update 操作；不能 delete 操作。只能用 drop（）方法删除整个 Collection。</li>
<li>默认基于 Insert 的次序排序的。如果查询时没有排序，则总是按照 insert 的顺序返回。</li>
<li>FIFO。如果超过了 Collection 的限定大小，则用 FIFO 算法，新记录将替代最先 insert 的 记录。</li>
<li>在 32 位机上，一个 capped collection 的最大值约为 482.5M，64 位上只受系统文件大小的限制。</li>
<li>MongoDB 中日志机制的首选，MongoDB 没有使用日志文件，而是把日志事件存储在数据库中。在一个没有索引的 capped collection 中插入对象的速度与在文件系统中记录日志的速度相当。 </li>
<li>可以利用 capped collection 的 age-out 特性，省去了写 cron 脚本进行人工归档的工作(auto archiving)。</li>
<li>为了发挥 capped collection 的最大性能，如果写比读多，最好不要在上面建索引，否则插入速度从”log speed”降为”database speed”。 </li>
<li>使用”nature ordering”可以有效地检索最近插入的元素，因为 capped collection 能够保证自然排序就是插入时的顺序，类似于 log 文件上的 tail 操作。</li>
<li>可以在创建 capped collection 时指定 collection 中能够存放的最大文档数。但这时也要指定 size，因为总是先检查 size 后检查maxRowNumber。可以使用 validate()查看一个 collection已经使用了多少空间，从而决定 size 设为多大。注意：max=1 时会往 collection 中存放尽量多的 documents。<br>db.createCollection(“mycoll”, {capped:true, size:100000, max:100});<br>db.mycoll.validate();</li>
<li>上述的 createCollection 函数也可以用来创建一般的 collection ，还有一个参数”autoIndexID”，值可以为”true”和”false”来决定是否需要在”_id”字段上自动创建索引，如：db.createCollection(“mycoll”, {size:10000000, autoIndexId:false})。默认情况下对一般的 collection 是创建索引的，但不会对 capped collection 创建。</li>
</ol>
<h2 id="Hint"><a href="#Hint" class="headerlink" title="Hint"></a>Hint</h2><p>　　一般情况下 MongoDB query optimizer 都工作良好，但有些情况下使用 hint()可以提高操作效 率。Hint可以强制要求查询操作使用某个索引。例如，如果要查询多个字段的值，如果在其中一个字段上有索引，可以使用 hint：db.collection.find({user:u, foo:d}).hint({user:1});</p>
<h2 id="explain"><a href="#explain" class="headerlink" title="explain"></a>explain</h2><p>　　MongoDB 提供了一个 explain（执行计划） 命令让我们获知系统如何处理查询请求。利用 explain 命令，我们可以很好地观察系统如何使用索引来加快检索，同时可以针对性优化索引。<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">&gt; db.t5.ensureIndex(&#123;name:<span class="number">1</span>&#125;)</span><br><span class="line">&gt; db.t5.ensureIndex(&#123;age:<span class="number">1</span>&#125;)</span><br><span class="line">&gt; db.t5.find(&#123;age:&#123;$gt:<span class="number">45</span>&#125;&#125;, &#123;name:<span class="number">1</span>&#125;).explain()</span><br><span class="line">&#123;</span><br><span class="line">        <span class="string">"cursor"</span> : <span class="string">"BtreeCursor age_1"</span>,</span><br><span class="line">        <span class="string">"nscanned"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"nscannedObjects"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"n"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"millis"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"nYields"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"nChunkSkips"</span> : <span class="number">0</span>,</span><br><span class="line">        <span class="string">"isMultiKey"</span> : <span class="literal">false</span>,</span><br><span class="line">        <span class="string">"indexOnly"</span> : <span class="literal">false</span>,</span><br><span class="line">        <span class="string">"indexBounds"</span> : &#123;</span><br><span class="line">                <span class="string">"age"</span> : [</span><br><span class="line">                        [</span><br><span class="line">                                <span class="number">45</span>,</span><br><span class="line">                                <span class="number">1.7976931348623157</span>e +<span class="number">308</span></span><br><span class="line">                        ]</span><br><span class="line">                ] </span><br><span class="line">        &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>字段说明:</p>
<ol>
<li>cursor: 返回游标类型(BasicCursor 或 BtreeCursor)</li>
<li>nscanned: 被扫描的文档数量</li>
<li>n: 返回的文档数量</li>
<li>millis: 耗时(毫秒)</li>
<li>indexBounds: 所使用的索引</li>
</ol>
<h2 id="Profiling"><a href="#Profiling" class="headerlink" title="Profiling"></a>Profiling</h2><p>　　在 MySQL 中，慢查询日志是经常作为我们优化数据库的依据，那在 MongoDB 中是否有类似的功能呢?答案是肯定的，那就是 MongoDB Database Profiler。所以 MongoDB 不仅有，而且还有一些比 MySQL的 Slow Query Log 更详细的信息。<br>　　有两种方式可以控制 Profiling 的开关和级别，第一种是直接在启动参数里直接进行设置。 启动 MongoDB 时加上–profile=级别 即可。也可以在客户端调用 db.setProfilingLevel( 级别) 命令来实时配置，Profiler 信息保存在 system.profile（capped collection） 中。我们可以通过 db.getProfilingLevel()命令来获取当前的 Profile 级别，类似如下操作 </p>
<blockquote>
<p>db.setProfilingLevel(2);<br>{ “was” : 0, “slowms” : 100, “ok” : 1 }<br>　　上面 profile 的级别可以取 0，1，2 三个值，他们表示的意义如下：0 – 不开启   1 – 记录慢命令 (默认为&gt;100ms)  2 – 记录所有命令<br>　　Profile 记录在级别 1 时会记录慢命令，那么这个慢的定义是什么？上面我们说到其默认为100ms。当然有默认就有设置，其设置方法和级别一样有两种，一种是通过添加–slowms 启动参数配置。第二种是调用 db.setProfilingLevel 时加上第二个参数：<br>db.setProfilingLevel( level , slowms )<br>db.setProfilingLevel( 1 , 10 );<br>　　与 MySQL 的慢查询日志不同，MongoDB Profile 记录是直接存在系统 db 里的，记录位置 system.profile ，所以，我们只要查询这个Collection 的记录就可以获取到我们的 Profile 记录了。列出执行时间长于某一限度(5ms)的 Profile 记录：db.system.profile.find( { millis : { $gt : 5 } } ) 。现在我们查看最新的 Profile 记录：<br>db.system.profile.find().sort({$natural:-1}).limit(1)<br>db.system.profile.find().sort({$natural:-1}).limit(1)<br>{ “ts” : ISODate(“2012-05-20T16:50:36.321Z”),<br>  “info” : “query test.system.profile reslen:1219 nscanned:8 query: { query: {}, orderby: { $natural: -1.0 } } nreturned:8 bytes:1203”,<br>  “millis” : 0<br>}</p>
<p>　　字段说明:</p>
<ol>
<li>ts： 该命令在何时执行</li>
<li>info: 本命令的详细信息</li>
<li>reslen: 返回结果集的大小</li>
<li>nscanned: 本次查询扫描的记录数</li>
<li>nreturned: 本次查询实际返回的结果集</li>
<li>millis: 该命令执行耗时，以毫秒记</li>
</ol>
</blockquote>
<p>　　MongoDB Shell 还提供了一个比较简洁的命令 show profile，可列出最近 5 条执行时间超过1ms 的 Profile 记录。</p>
<h2 id="u67E5_u770B_u6D3B_u52A8_u8FDB_u7A0B"><a href="#u67E5_u770B_u6D3B_u52A8_u8FDB_u7A0B" class="headerlink" title="查看活动进程"></a>查看活动进程</h2><p>　　查看活动进程，便于了解系统正在做什么，以便做下一步判断<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&gt; db.currentOp();</span><br><span class="line">&gt; <span class="comment">// 等同于: db.$cmd.sys.inprog.findOne()</span></span><br><span class="line">&#123; inprog: [ &#123; <span class="string">"opid"</span> : <span class="number">18</span> , <span class="string">"op"</span> : <span class="string">"query"</span> , <span class="string">"ns"</span> :<span class="string">"mydb.votes"</span> ,</span><br><span class="line">              <span class="string">"query"</span> : <span class="string">"&#123; score : 1.0 &#125;"</span> , <span class="string">"inLock "</span> : <span class="number">1</span> &#125;</span><br><span class="line">          ]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>字段说明:<br>Opid: 操作进程号<br>Op: 操作类型(查询，更新等)<br>Ns: 命名空间, 指操作的是哪个对象<br>Query: 如果操作类型是查询的话，这里将显示具体的查询内容<br>lockType: 锁的类型，指明是读锁还是写锁</p>
<h2 id="u7ED3_u675F_u8FDB_u7A0B"><a href="#u7ED3_u675F_u8FDB_u7A0B" class="headerlink" title="结束进程"></a>结束进程</h2><p>　　如果某个异常是由于某个进程产生的，那么一般 DBA 都会毫不留情的杀掉这个罪魁祸首的进程<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&gt; db.killOp(<span class="number">1234</span><span class="comment">/*opid*/</span>)</span><br><span class="line">&gt; <span class="comment">// 等同于: db.$cmd.sys.killop.findOne(&#123;op:1234&#125;)</span></span><br></pre></td></tr></table></figure></p>
<p>　　注意:不要 kill 内部发起的操作，比如说 replica set 发起的 sync 操作等</p>
<h2 id="u4E3B_u4ECE_u64CD_u4F5C_u65E5_u5FD7"><a href="#u4E3B_u4ECE_u64CD_u4F5C_u65E5_u5FD7" class="headerlink" title="主从操作日志"></a>主从操作日志</h2><p>　　MongoDB 的 Replica Set 架构是通过一个日志来存储写操作的，这个日志就叫做”oplog”。 oplog.rs 是一个固定长度的 capped collection，它存在于”local”数据库中，用于记录 Replica Sets 操作日志。在默认情况下，对于 64 位的 MongoDB，oplog 是比较大的，可以达到 5%的磁 盘空间。oplog 的大小是可以通过 mongod 的参数”—oplogSize”来改变 oplog 的日志大小。该原理与Mysql类似。</p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2015/12/18/mongodb/11.mongodb系列之优化/" data-id="cijzzpvaz009v1cfsx8ezjhnw" class="article-share-link">Share</a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/mongodb/">mongodb</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2015/12/18/mongodb/12.mongodb系列之性能监控/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          mongodb系列十二之性能监控
        
      </div>
    </a>
  
  
    <a href="/2015/12/18/mongodb/10.mongodb系列之访问控制/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">mongodb系列十之访问控制</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Categories</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/cache/">cache</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">13</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/docker/">docker</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gis/">gis</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/git/">git</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/go/">go</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/gradle/">gradle</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/groovy/">groovy</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/hadoop/">hadoop</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/java/">java</a><span class="category-list-count">18</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/log/">log</a><span class="category-list-count">11</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mongodb/">mongodb</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mq/">mq</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/mybatis/">mybatis</a><span class="category-list-count">9</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/netty/">netty</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nginx/">nginx</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nio/">nio</a><span class="category-list-count">19</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/nodejs/">nodejs</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/redis/">redis</a><span class="category-list-count">6</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/rpc/">rpc</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/spring/">spring</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/tomcat/">tomcat</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/zookeeper/">zookeeper</a><span class="category-list-count">2</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/杂项/">杂项</a><span class="category-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/aop/">aop</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/aspectj/">aspectj</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cache/">cache</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/classloader/">classloader</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/common-loggings/">common-loggings</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/commonjs/">commonjs</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/database/">database</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/docker/">docker</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dubbo/">dubbo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/fastdfs/">fastdfs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gclib/">gclib</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/geohash/">geohash</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gis/">gis</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/go/">go</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/gradle/">gradle</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/groovy/">groovy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hadoop/">hadoop</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hessisan/">hessisan</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/java/">java</a><span class="tag-list-count">48</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/javassist/">javassist</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/kafka/">kafka</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log4j/">log4j</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/logback/">logback</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/map/">map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/memecached/">memecached</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mina/">mina</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mongodb/">mongodb</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mq/">mq</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mqtt/">mqtt</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/mybatis/">mybatis</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/netty/">netty</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nio/">nio</a><span class="tag-list-count">5</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nodejs/">nodejs</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/postgresql/">postgresql</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/protobuf/">protobuf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/proxy/">proxy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/push/">push</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rabbitmq/">rabbitmq</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/redis/">redis</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpc/">rpc</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sitemesh/">sitemesh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/sld/">sld</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/slf4j/">slf4j</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/socket/">socket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spatialite-for-android/">spatialite for android</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spi/">spi</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/spring/">spring</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/tomcat/">tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/transaction/">transaction</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/web/">web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xSocket/">xSocket</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zbus/">zbus</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/zookeeper/">zookeeper</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/数据结构/">数据结构</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/aop/" style="font-size: 15.38px;">aop</a> <a href="/tags/aspectj/" style="font-size: 11.54px;">aspectj</a> <a href="/tags/cache/" style="font-size: 11.54px;">cache</a> <a href="/tags/classloader/" style="font-size: 10px;">classloader</a> <a href="/tags/common-loggings/" style="font-size: 10px;">common-loggings</a> <a href="/tags/commonjs/" style="font-size: 12.31px;">commonjs</a> <a href="/tags/database/" style="font-size: 16.92px;">database</a> <a href="/tags/docker/" style="font-size: 13.85px;">docker</a> <a href="/tags/dubbo/" style="font-size: 10px;">dubbo</a> <a href="/tags/fastdfs/" style="font-size: 10px;">fastdfs</a> <a href="/tags/gclib/" style="font-size: 10.77px;">gclib</a> <a href="/tags/geohash/" style="font-size: 10px;">geohash</a> <a href="/tags/gis/" style="font-size: 10px;">gis</a> <a href="/tags/git/" style="font-size: 10.77px;">git</a> <a href="/tags/go/" style="font-size: 10px;">go</a> <a href="/tags/gradle/" style="font-size: 10px;">gradle</a> <a href="/tags/groovy/" style="font-size: 10px;">groovy</a> <a href="/tags/hadoop/" style="font-size: 10px;">hadoop</a> <a href="/tags/hessisan/" style="font-size: 11.54px;">hessisan</a> <a href="/tags/java/" style="font-size: 20px;">java</a> <a href="/tags/javassist/" style="font-size: 10px;">javassist</a> <a href="/tags/kafka/" style="font-size: 11.54px;">kafka</a> <a href="/tags/linux/" style="font-size: 12.31px;">linux</a> <a href="/tags/log/" style="font-size: 17.69px;">log</a> <a href="/tags/log4j/" style="font-size: 12.31px;">log4j</a> <a href="/tags/logback/" style="font-size: 13.08px;">logback</a> <a href="/tags/map/" style="font-size: 10px;">map</a> <a href="/tags/memecached/" style="font-size: 10.77px;">memecached</a> <a href="/tags/mina/" style="font-size: 13.08px;">mina</a> <a href="/tags/mongodb/" style="font-size: 19.23px;">mongodb</a> <a href="/tags/mq/" style="font-size: 13.85px;">mq</a> <a href="/tags/mqtt/" style="font-size: 10.77px;">mqtt</a> <a href="/tags/mybatis/" style="font-size: 16.15px;">mybatis</a> <a href="/tags/netty/" style="font-size: 10px;">netty</a> <a href="/tags/nginx/" style="font-size: 11.54px;">nginx</a> <a href="/tags/nio/" style="font-size: 13.08px;">nio</a> <a href="/tags/nodejs/" style="font-size: 10px;">nodejs</a> <a href="/tags/postgresql/" style="font-size: 10.77px;">postgresql</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/proxy/" style="font-size: 10px;">proxy</a> <a href="/tags/push/" style="font-size: 10px;">push</a> <a href="/tags/rabbitmq/" style="font-size: 11.54px;">rabbitmq</a> <a href="/tags/redis/" style="font-size: 13.85px;">redis</a> <a href="/tags/rpc/" style="font-size: 19.23px;">rpc</a> <a href="/tags/sitemesh/" style="font-size: 10px;">sitemesh</a> <a href="/tags/sld/" style="font-size: 10px;">sld</a> <a href="/tags/slf4j/" style="font-size: 10px;">slf4j</a> <a href="/tags/socket/" style="font-size: 14.62px;">socket</a> <a href="/tags/spatialite-for-android/" style="font-size: 10px;">spatialite for android</a> <a href="/tags/spi/" style="font-size: 10px;">spi</a> <a href="/tags/spring/" style="font-size: 18.46px;">spring</a> <a href="/tags/tomcat/" style="font-size: 10.77px;">tomcat</a> <a href="/tags/transaction/" style="font-size: 10px;">transaction</a> <a href="/tags/web/" style="font-size: 10px;">web</a> <a href="/tags/xSocket/" style="font-size: 14.62px;">xSocket</a> <a href="/tags/zbus/" style="font-size: 10px;">zbus</a> <a href="/tags/zookeeper/" style="font-size: 10.77px;">zookeeper</a> <a href="/tags/数据结构/" style="font-size: 10.77px;">数据结构</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">January 2016</a><span class="archive-list-count">67</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">December 2015</a><span class="archive-list-count">81</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">November 2015</a><span class="archive-list-count">2</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recents</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2016/01/30/资料/">(no title)</a>
          </li>
        
          <li>
            <a href="/2016/01/30/java/13.Classloader系列一/">ClassLoader系列一</a>
          </li>
        
          <li>
            <a href="/2016/01/29/hadoop/1.hadoop系列之源码编译/">hadoop系列一之源码编译</a>
          </li>
        
          <li>
            <a href="/2016/01/29/go/1.GO系列之入门/">Go系列一之入门</a>
          </li>
        
          <li>
            <a href="/2016/01/28/tomcat/2.tomcat性能优化/">tomcat性能优化</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2016 John Doe<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="http://libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

  </div>
</body>
</html>